Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Windows 10 / Reduce Large Windows.edb (Windows.db) File Size

March 15, 2024 Windows 10Windows 11Windows Server 2019Windows Server 2022

Reduce Large Windows.edb (Windows.db) File Size

The Windows.edb file (Windows.db in Windows 11) is the location of the index database for the Windows Search service. The search index allows users to quickly search for files, emails in PST files, and other content on the hard drive. Background indexing is performed by the SearchIndexer.exe process. If you have a large number of files, the size of the Windows.edb index file can grow up to tens or even hundreds of GB, taking up the free space on the system drive.

Contents:
  • How to Reset and Rebuild Windows Search Index
  • Reduce the Size of Windows.edb File Using Defragmentation
  • Delete Large Windows.edb File and Reset Windows Search Index
  • Moving the Windows.edb File to Another Drive
  • Fixing Windows.edb Large File Size Problem

The hidden Windows.edb file is stored by default in the  C:\ProgramData\Microsoft\Search\Data\Applications\Windows\ folder.

In Windows 11, the Windows.db file is used to store the search service index instead of the Windows.edb file.

If you want to quickly check the current size of the Windows.edb file, use the PowerShell command:

((Get-Item $env:programdata'\Microsoft\Search\Data\Applications\Windows\Windows.edb').length/1GB)

powershell get windows.edb file size

In my example, when searching for large files on the system drive, I found that the Windows.edb file had grown to over 15GB (almost 15% on my 100GB SSD drive).

huge Windows.edb file

Let’s look at some ways to reduce the size of the huge Windows search index file (Windows.edb).

How to Reset and Rebuild Windows Search Index

The Windows Search Service allows you to reduce the size of the Windows.edb file by completely rebuilding the search index.

  1. Go to Settings -> Search -> Searching Windows -> Advanced Search Indexer Settings (in the case of the Classic Control Panel, go to Indexing Options, or run the command control srchadmin.dll); Search Service settings in Windows
  2. Click Advanced -> Rebuild;rebuild windows search index
  3. Windows Search will delete the old Windows.edb file, recreate it, scan the drives (and other indexed locations), and rebuild the index. This process can take a long time depending on the number of files.

Reduce the Size of Windows.edb File Using Defragmentation

The Windows Search Index file is a Microsoft EDB database. You can perform offline defragmentation of the EDB database using the built-in esentutl.exe command (which should be familiar to Exchange Serve admins). Stop the Windows Search service and defragment the Windows.edb file offline using the following batch:

sc config wsearch start=disabled
sc stop wsearch
esentutl.exe /d %ProgramData%\Microsoft\Search\Data\Applications\Windows\Windows.edb
sc config wsearch start=delayed-auto
sc start wsearch

Tip. There should be enough free space on the hard drive to run the defragmentation as a full copy of the EDB file will be created.

defrag Windows-edb with esentutl

Defragmentation can reduce the size of the search index database by 20-50%.

This method can be used to defragment the Search service file on all versions of Windows except Windows 11. In Windows 11, the new Windows.db search index file with an SQLite database is used instead of the Windows.edb with a JET database type. Esentutl.exe cannot be used to defragment SQLite databases.

Delete Large Windows.edb File and Reset Windows Search Index

If you are running out of disk space, you can manually delete the Windows.edb file. This is safe because you won’t lose any data, only the search index will be reset. Stop the Windows Search service, delete the Windows.edb file, and start the service again.

net stop "Windows Search"
REG ADD "HKLM\SOFTWARE\Microsoft\Windows Search" /v SetupCompletedSuccessfully /t REG_DWORD /d 0 /f
del %PROGRAMDATA%\Microsoft\Search\Data\Applications\Windows\Windows.edb
net start "Windows Search"

The registry parameter SetupCompletedSuccessfully = 0 forces the Windows Search service to restore the default settings.

After you restart Windows Search, it will start the background reindexing process and rebuild the Windows.edb file (computer performance may be degraded during reindexing).

Moving the Windows.edb File to Another Drive

In some scenarios, users may actively use Windows Search to find data on local drives (for example, searching in folders and personal PST files is often used by RDS server users). In this case, if you cannot radically reduce the size of Windows.edb or permanently reset the search index, you can move the search index file from the system partition to another drive (volume).

To change the location of the index file, go to Control Panel -> Indexing Options -> Advanced -> Index location-> New Location, specify the path to the new location of the Windows.edb file, and click Ok.

Restart Windows Search service:
Restart-Service wsearch

move search index file

Fixing Windows.edb Large File Size Problem

If your Windows.edb file continues to grow in size after you defragment and/or rebuild the search index, try the following methods, which may help resolve the problem.

  1. Run the built-in Windows Search and Indexing Troubleshooter using the command: msdt.exe -ep SystemSettings_Troubleshoot_L2 -id SearchDiagnostic . Select “Search or indexing is slow” in the list. The wizard will then attempt to restore the Windows Search service to its default state;win10 search and index troubleshooter - fix wsearch service
  2. Try to index only the local content you need. Exclude from the search index items you are not looking for. Click the ‘Modify‘ button in the indexing settings and uncheck any paths and apps that you don’t want to be indexed in the Indexing Location. Rebuild the index after changing the index path settings (Advanced -> Rebuild);  windows 10 set indexing locations
  3. If you are using Outlook with PST files on your computer, the size of the Windows.edb file increases in proportion to the size of the PST files as they are indexed. This can cause the hard drive to run out of space and cause computer performance problems. In this case, Microsoft recommends that you exclude Outlook from the list of indexed items. disable outlook and pst files indexing on windows 10Of course, Outlook search will stop working (this won’t be a problem if the mailbox is hosted on an Exchange Server with search indexing enabled);
  4. If nothing helps and the Windows.edb file size keeps growing, you can disable the wsearch service completely or configure a logon script to reset the search index at startup.
13 comments
3
Facebook Twitter Google + Pinterest
previous post
How to Check or Update Java Version in Windows with PowerShell?
next post
Configuring High Performance NGINX and PHP-FPM Web Server

Related Reading

Configure NTP Time Source for Active Directory Domain

May 6, 2025

How to Cancel Windows Update Pending Restart Loop

May 6, 2025

View Windows Update History with PowerShell (CMD)

April 30, 2025

Cannot Install Network Adapter Drivers on Windows Server

April 29, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 21, 2025

13 comments

Kimi January 8, 2019 - 3:24 am

This issue is not only related to Win8 and 2012.

It also happened with Win 10. very terrible.

Reply
William February 7, 2019 - 3:25 pm

This is exactly what I was looking for. Thanks for your help!

Reply
Lou April 7, 2019 - 7:53 am

You saved my life!

Reply
Tony May 8, 2019 - 12:26 am

1st, thank you for this – was running out of space very fast and just caught it in time.

::On Server 2012 R2::
I had a “cant find file” error when i ran this: “esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb”
My work around was to navigate to the actual directory the .edb file was in:
# cd /d %ProgramData%\Microsoft\Search\Data\Applications\Windows
then run:
# esentutl.exe /d Windows.edb
This worked and our file went from 74GB to 120MB.

Reply
Mikhail September 22, 2019 - 7:32 pm

My file windows.edb was 327 GB. it took all space on C: drive. Thanks a lot for help.

Reply
Meny Assis October 10, 2019 - 1:11 pm

Thank you for your help
life saver

Reply
KB March 6, 2020 - 5:07 pm

377 GB -> 8 MB with the first step.
THANK YOU.

Reply
Jonas August 9, 2020 - 7:00 pm

Thanks, great tip with the defragmentation! Reduced size by 60% in my case, and no need to rebuild the DB.

Reply
Ron February 16, 2021 - 10:57 pm

Thank you so much for the informative article. I’ve been constantly running out of disk space on my laptop’s 250GB drive, when I noticed that my windows.edb file was close to 50GB in size. I did a Delete and Rebuild of my index and the new index shrank down to 340MB, giving me back close to 50GB of disk space.

Reply
Ron February 16, 2021 - 10:59 pm

Oh, and the reindexing took less than a half hour, so it was very fast.

Reply
dekobrist June 16, 2021 - 9:27 am

Article didn’t help – issue still actual on Windows Server 2019 and after index rebuilding it continue to grow.

Reply
Bene007 July 26, 2021 - 1:53 pm

Thank you the Windows.edb was so so Heavy – > Hard Disk almost Full
Solution : Rebuild

Reply
Shakel March 7, 2023 - 7:10 pm

Thanks, that was very helpfull!

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMware
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025
  • How to Write Logs to the Windows Event Viewer from PowerShell/CMD

    March 3, 2025
  • How to Hide (Block) a Specific Windows Update

    February 25, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • Fix: Windows Cannot Connect to a Shared Printer
  • How to Disable UAC Prompt for Specific Applications in Windows
  • Fix: The Computer Restarted Unexpectedly or Encountered an Unexpected Error on Windows
  • How to Clean Up System Volume Information Folder on Windows
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10
  • How to Enable Windows Auto Login without a Password
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top